<?php
/* @var $this UserPositionLevelController */
/* @var $dataProvider CActiveDataProvider */

$this->breadcrumbs=array(
	'User Position Levels',
);

$this->menu=array(
	array('label'=>'Create UserPositionLevel', 'url'=>array('create')),
	array('label'=>'Manage UserPositionLevel', 'url'=>array('admin')),
);

Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl . "/global/js/pages/adminUserLevel.js");
?>
<script>
var _siteUrl = '<?php echo  Yii::app()->params['siteUrl']?>';
</script>

<span class="page_h3">元素职级管理</span>
<div style="padding:3px;">
    <table class="s_table">
    	<tr>
            <td width="200">元素：</td>
            <td>
            <input name="s_username" value="<?php echo $search['s_username'];?>" id="s_username" class="small_input"  />
            </td>
        </tr>
        <tr>
            <td width="200">部门：</td>
            <td>
            <?php  echo CHtml::dropDownList('s_department' ,$search['s_department'] ,$departmentOption ,array('class'=>'mid_select2')); ?>
            </td>
        </tr>
        <tr>
            <td>分类：</td>
            <td>
            <?php echo CHtml::dropDownList('attr_id' ,isset($search['attr_id'])?$search['attr_id']:0 ,$paOption,array('class'=>'big_select')); ?>
            </td>
        </tr>
        <tr>
            <td> L：</td>
            <td>
            <?php echo CHtml::dropDownList('attr_L_id' ,isset($search['L'])?$search['L']:0 ,array(0=>'请选择'),array('class'=>'big_select')); ?>
            </td>
        </tr>
        <tr>
            <td> M：</td>
            <td>
            <?php echo CHtml::dropDownList('attr_M_id' ,isset($search['M'])?$search['M']:0 ,$positionLevelOptionM,array('class'=>'big_select')); ?>
            </td>
        </tr>
        <tr>
            <td> B：</td>
            <td>
            <input name="attr_B_id" value="<?php echo $search['B']; ?>" id="attr_B_id" class="small_input"  />
            </td>
        </tr>
        <tr>
            <td>
            
            </td>
            <td colspan="2">
                <input type="button"  value="Search" class="c_button" id="search_user_level" /> 
                <input type="button"  value="Export" class="c_button" id="export_user_level" />
            </td>
        </tr>
    </table>
</div>

<?php
$this->widget('zii.widgets.grid.CGridView', array(
    'id'=>'user-grid-view',
    'dataProvider'=>$dataProvider,
	'columns'=>array( 
		'id',
		'unique_id',
		array(
			'name'=>'元素',
			'value'=> 'HecUser::getInfoByUniqueid($data->unique_id,"c_username")'
		),
		//'attr_id',
		array(
			'name'=>'分类',
			'value'=> 'HrPositionAttribute::getInfoById($data->attr_id,"title")'
		),
		
		array(
			'name'=>'L',
			'value'=> 'HrPositionLevel::getInfoById($data->attr_L_id,"name")'
		),
		array(
			'name'=>'M',
			'value'=> 'HrPositionLevel::getInfoById($data->attr_M_id,"name")'
		), 
		array(
			'name'=>'B',
		),
		array(
			'name'=>'职位',
			'value'=> '$data->title . " | " .$data->title_en'
		),
		
		array(            // display a column with "view", "update" and "delete" buttons
            'class'=>'CButtonColumn',
			'template'=>'{update}{detail}',
			'buttons'=>array(
				'update' => array(
						'label'=>'修改',     // text label of the button
						'url'=>'Yii::app()->controller->createUrl("userPositionLevel/update",array("id"=>$data->primaryKey))',       // a PHP expression for generating the URL of the button
						'imageUrl'=>Yii::app()->request->baseUrl.'/global/img/icons/page_white_edit.png',  // image URL of the button. If not set or false, a text link is used
						'options'=>array('style'=>'cursor:pointer;' , 'target'=>'_blank'), // HTML options for the button tag
						'visible'=>'true',
				),
				'detail' => array(
						'label'=>'详情',     // text label of the button
						'url'=>'Yii::app()->controller->createUrl("userPositionLevel/detail",array("id"=>$data->primaryKey))',       // a PHP expression for generating the URL of the button
						'imageUrl'=>Yii::app()->request->baseUrl.'/global/img/icons/magnifier.png',  // image URL of the button. If not set or false, a text link is used
						'options'=>array('style'=>'cursor:pointer;' , 'target'=>'_blank'), // HTML options for the button tag
						'visible'=>'true',
				),
            ),
			
        ),
		), 
		
));
?>